Skip to content

PG-1058: adding responses and mcp components#56

Merged
jmansdorfer merged 5 commits intomainfrom
jacob/add-responses
Mar 2, 2026
Merged

PG-1058: adding responses and mcp components#56
jmansdorfer merged 5 commits intomainfrom
jacob/add-responses

Conversation

@jmansdorfer
Copy link
Contributor

No description provided.

Copy link

@bengsoon bengsoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes proposed for this PR:

  • tool_choice: make it clearer what is allowed. also required is not allowed at the backend
  • tools: more descriptive instructions on how to use registered tools, custom mcps and functions

Worthwhile considerations not in this PR:

  • truncation param (OpenAI ref) will be helpful to not fail unexpectedly if size exceeds window size for a model

Future improvements as a separate PR:

  • More descriptive docstrings and type hints

Question

  • Will we have conversation state persistence in our Responses API (e.g. this)

:param parallel_tool_calls: The parallel tool calls to use.
:param reasoning: How much effort for model to use for reasoning. Only supported by reasoning models.
:param safeguards: A dictionary containing the PII, injection, factuality, and toxicity arguments.
:param stream: Option to stream the API response
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmansdorfer You may want to add a note "Not currently supported."?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

:param stream: Option to stream the API response
:param temperature: The consistency of the model responses to the same prompt. The higher it is set, the more consistent.
:param tool_choice: The tool choice to use.
:param tools: Options to pass to the tool choice.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need a clearer docs to highlight types of tools that we support and we'd want to demonstrate how to use org-level registered tools and external mcp tools as examples?

  • Registered tools: Registered tools on your organization, for example:
pg-web-search-tool`, then  `tools=[{"type": "pg-web-search-tool"}]`
  • MCP tools: Integration with third-party systems via custom MCP servers, for example:
tools = [
      {
        "type": "mcp",
        "server_url": "https://your-mcp-server.yourcompany.com/mcp/",
        "server_label": "your-server-label",
        "server_description": "Description of what this MCP server provides",
        "authorization": "Your Bearer Token",
        "allowed_tools": ["tool_name_1", "tool_name_2"]
      }
    ]
  • Function calls:
tools = [
    {
      "type": "function",
      "name": "get_current_weather",
      "parameters": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "enum": [
              "celsius",
              "fahrenheit"
            ]
          }
        },
        "required": [
          "location"
        ]
      },
      "strict": false,
      "description": "Get the current weather in a given location"
    }
]
   

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add this as an example here, but that might be more at home in our main docs

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ISWYM. Perhaps at least each type and links to our docs for each of them?

@jmansdorfer jmansdorfer merged commit 5171d46 into main Mar 2, 2026
1 check passed
@jmansdorfer jmansdorfer deleted the jacob/add-responses branch March 2, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants